﻿using System;
using System.Collections.Generic;
using ProjScan.Submodules.Shader_Analysis.Build;
using UnityEngine;

namespace ProjScan.Tools
{
	// Token: 0x0200015C RID: 348
	public class ApiCompatibilityUtils
	{
		// Token: 0x06000C6F RID: 3183 RVA: 0x000066B6 File Offset: 0x000048B6
		private ApiCompatibilityUtils()
		{
		}

		// Token: 0x06000C70 RID: 3184 RVA: 0x00036BD8 File Offset: 0x00034DD8
		internal bool CheckStrippingManagedCode()
		{
			bool flag = this._comApi != null;
			return !flag || this._comApi.CheckStrippingManagedCode();
		}

		// Token: 0x06000C71 RID: 3185 RVA: 0x00036C08 File Offset: 0x00034E08
		internal string[] CompileAssemblies(string folder)
		{
			bool flag = this._comApi != null;
			string[] result;
			if (flag)
			{
				result = this._comApi.CompileAssemblies(folder);
			}
			else
			{
				result = null;
			}
			return result;
		}

		// Token: 0x06000C72 RID: 3186 RVA: 0x00036C38 File Offset: 0x00034E38
		internal bool HasCompileError()
		{
			bool flag = this._comApi != null;
			return !flag || this._comApi.HasCompileError();
		}

		// Token: 0x06000C73 RID: 3187 RVA: 0x00036C68 File Offset: 0x00034E68
		internal string GetAssemblyDefinitionFilePath(string asmName)
		{
			bool flag = this._comApi != null;
			string result;
			if (flag)
			{
				result = this._comApi.GetAssemblyDefinitionFilePath(asmName);
			}
			else
			{
				result = null;
			}
			return result;
		}

		// Token: 0x06000C74 RID: 3188 RVA: 0x00036C98 File Offset: 0x00034E98
		internal string[] GetAssemblyPaths()
		{
			bool flag = this._comApi != null;
			string[] result;
			if (flag)
			{
				result = this._comApi.GetAssemblyPaths();
			}
			else
			{
				result = null;
			}
			return result;
		}

		// Token: 0x06000C75 RID: 3189 RVA: 0x00036CC8 File Offset: 0x00034EC8
		internal string[] GetEnvironmentVariables()
		{
			bool flag = this._comApi != null;
			string[] result;
			if (flag)
			{
				result = this._comApi.GetEnvironmentVariables();
			}
			else
			{
				result = null;
			}
			return result;
		}

		// Token: 0x06000C76 RID: 3190 RVA: 0x00036CF8 File Offset: 0x00034EF8
		internal bool Ready()
		{
			return this._comApi != null;
		}

		// Token: 0x06000C77 RID: 3191 RVA: 0x00036D14 File Offset: 0x00034F14
		internal void RegisterEditorExitPlayMode(Action cb)
		{
			bool flag = this._comApi != null;
			if (flag)
			{
				this._comApi.RegisterEditorExitPlayMode(cb);
			}
		}

		// Token: 0x06000C78 RID: 3192 RVA: 0x00036D40 File Offset: 0x00034F40
		internal void RegisterEditorPauseMode(Action<bool> cb)
		{
			bool flag = this._comApi != null;
			if (flag)
			{
				this._comApi.RegisterEditorPauseMode(cb);
			}
		}

		// Token: 0x06000C79 RID: 3193 RVA: 0x00036D6C File Offset: 0x00034F6C
		internal void RegisterProcessShader(Action<Shader, UPS_SSD, List<UPS_SCD>> cb)
		{
			bool flag = this._comApi != null;
			if (flag)
			{
				this._comApi.RegisterProcessShader(cb);
			}
		}

		// Token: 0x06000C7A RID: 3194 RVA: 0x00036D98 File Offset: 0x00034F98
		internal void Reset()
		{
			bool flag = this._comApi != null;
			if (flag)
			{
				this._comApi.Reset();
			}
		}

		// Token: 0x06000C7B RID: 3195 RVA: 0x000066C7 File Offset: 0x000048C7
		public void Setup(ICompatApi api)
		{
			this._comApi = api;
		}

		// Token: 0x06000C7C RID: 3196 RVA: 0x00036DC4 File Offset: 0x00034FC4
		internal void UPS_BuildPlayer(string[] scenesInBuild)
		{
			bool flag = this._comApi != null;
			if (flag)
			{
				this._comApi.UPS_BuildPlayer(scenesInBuild);
			}
		}

		// Token: 0x17000340 RID: 832
		// (get) Token: 0x06000C7D RID: 3197 RVA: 0x00036DF0 File Offset: 0x00034FF0
		// (set) Token: 0x06000C7E RID: 3198 RVA: 0x000066D1 File Offset: 0x000048D1
		public static bool ProjScanShaderProcessorOn
		{
			get
			{
				return ApiCompatibilityUtils.projScanShaderProcessorOn;
			}
			set
			{
				ApiCompatibilityUtils.projScanShaderProcessorOn = value;
			}
		}

		// Token: 0x040007A2 RID: 1954
		private static bool projScanShaderProcessorOn = false;

		// Token: 0x040007A3 RID: 1955
		private float version;

		// Token: 0x040007A4 RID: 1956
		public static readonly ApiCompatibilityUtils Instance = new ApiCompatibilityUtils();

		// Token: 0x040007A5 RID: 1957
		private ICompatApi _comApi = null;
	}
}
